Convert GailFrame to GtkFrameAccessible
authorMatthias Clasen <mclasen@redhat.com>
Mon, 27 Jun 2011 02:13:15 +0000 (22:13 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 5 Jul 2011 20:08:53 +0000 (16:08 -0400)
gtk/a11y/Makefile.am
gtk/a11y/gail.c
gtk/a11y/gailframe.c [deleted file]
gtk/a11y/gailframe.h [deleted file]
gtk/a11y/gtkframeaccessible.c [new file with mode: 0644]
gtk/a11y/gtkframeaccessible.h [new file with mode: 0644]
gtk/gtkframe.c

index 6031514c6716eabef15fb987b2f4cd8edb09bf44..a41c16bad6bfe389a08223ceb2f37da8b1b240dd 100644 (file)
@@ -18,7 +18,7 @@ gail_c_sources =                      \
        gailcontainercell.c             \
        gtkentryaccessible.c            \
        gailexpander.c                  \
-       gailframe.c                     \
+       gtkframeaccessible.c            \
        gailimage.c                     \
        gailimagecell.c                 \
        gtklabelaccessible.c            \
@@ -70,7 +70,7 @@ gail_private_h_sources =              \
        gtkentryaccessible.h            \
        gailexpander.h                  \
        gailfactory.h                   \
-       gailframe.h                     \
+       gtkframeaccessible.h            \
        gailimage.h                     \
        gailimagecell.h                 \
        gtklabelaccessible.h            \
index ed1b3e841ebc98ba764f8a944a96b0273b77d5a0..3160cf2a1550fb2da3a2baae93490e1f06a24dad 100644 (file)
@@ -32,7 +32,6 @@
 #include "gailcontainer.h"
 #include "gailcontainercell.h"
 #include "gailexpander.h"
-#include "gailframe.h"
 #include "gailimage.h"
 #include "gailimagecell.h"
 #include "gaillinkbutton.h"
@@ -121,7 +120,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_STATUSBAR, GailStatusbar, gail_statusbar, GTK_
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_NOTEBOOK, GailNotebook, gail_notebook, GTK_TYPE_NOTEBOOK)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PROGRESS_BAR, GailProgressBar, gail_progress_bar, GTK_TYPE_PROGRESS_BAR)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TREE_VIEW, GailTreeView, gail_tree_view, GTK_TYPE_TREE_VIEW)
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_FRAME, GailFrame, gail_frame, GTK_TYPE_FRAME)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RADIO_BUTTON, GailRadioButton, gail_radio_button, GTK_TYPE_RADIO_BUTTON)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, GailScrolledWindow, gail_scrolled_window, GTK_TYPE_SCROLLED_WINDOW)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PANED, GailPaned, gail_paned, GTK_TYPE_PANED)
@@ -890,7 +888,6 @@ gail_accessibility_module_init (void)
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_NOTEBOOK, gail_notebook);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_PROGRESS_BAR, gail_progress_bar);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_TREE_VIEW, gail_tree_view);
-  GAIL_WIDGET_SET_FACTORY (GTK_TYPE_FRAME, gail_frame);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TEXT, gail_text_cell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell);
diff --git a/gtk/a11y/gailframe.c b/gtk/a11y/gailframe.c
deleted file mode 100644 (file)
index 7806837..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <string.h>
-#include <gtk/gtk.h>
-#include "gailframe.h"
-
-static void                  gail_frame_class_init       (GailFrameClass  *klass);
-static void                  gail_frame_init             (GailFrame       *frame);
-static void                  gail_frame_initialize       (AtkObject       *accessible,
-                                                          gpointer         data);
-static const gchar* gail_frame_get_name         (AtkObject       *obj);
-
-G_DEFINE_TYPE (GailFrame, gail_frame, GAIL_TYPE_CONTAINER)
-
-static void
-gail_frame_class_init (GailFrameClass *klass)
-{
-  AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
-  class->initialize = gail_frame_initialize;
-  class->get_name = gail_frame_get_name;
-}
-
-static void
-gail_frame_init (GailFrame       *frame)
-{
-}
-
-static void
-gail_frame_initialize (AtkObject *accessible,
-                       gpointer  data)
-{
-  ATK_OBJECT_CLASS (gail_frame_parent_class)->initialize (accessible, data);
-
-  accessible->role = ATK_ROLE_PANEL;
-}
-
-static const gchar*
-gail_frame_get_name (AtkObject *obj)
-{
-  const gchar *name;
-  g_return_val_if_fail (GAIL_IS_FRAME (obj), NULL);
-
-  name = ATK_OBJECT_CLASS (gail_frame_parent_class)->get_name (obj);
-  if (name != NULL)
-  {
-    return name;
-  }
-  else
-  {
-    /*
-     * Get the text on the label
-     */
-    GtkWidget *widget;
-
-    widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
-    if (widget == NULL)
-    {
-      /*
-       * State is defunct
-       */
-      return NULL;
-    }
-    return gtk_frame_get_label (GTK_FRAME (widget));
-  }
-}
diff --git a/gtk/a11y/gailframe.h b/gtk/a11y/gailframe.h
deleted file mode 100644 (file)
index 61b61b4..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_FRAME_H__
-#define __GAIL_FRAME_H__
-
-#include "gailcontainer.h"
-
-G_BEGIN_DECLS
-
-#define GAIL_TYPE_FRAME                      (gail_frame_get_type ())
-#define GAIL_FRAME(obj)                      (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_FRAME, GailFrame))
-#define GAIL_FRAME_CLASS(klass)              (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_FRAME, GailFrameClass))
-#define GAIL_IS_FRAME(obj)                   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_FRAME))
-#define GAIL_IS_FRAME_CLASS(klass)           (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_FRAME))
-#define GAIL_FRAME_GET_CLASS(obj)            (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_FRAME, GailFrameClass))
-
-typedef struct _GailFrame                   GailFrame;
-typedef struct _GailFrameClass              GailFrameClass;
-
-struct _GailFrame
-{
-  GailContainer parent;
-};
-
-GType gail_frame_get_type (void);
-
-struct _GailFrameClass
-{
-  GailContainerClass parent_class;
-};
-
-G_END_DECLS
-
-#endif /* __GAIL_FRAME_H__ */
diff --git a/gtk/a11y/gtkframeaccessible.c b/gtk/a11y/gtkframeaccessible.c
new file mode 100644 (file)
index 0000000..964ddb9
--- /dev/null
@@ -0,0 +1,67 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include "gtkframeaccessible.h"
+
+
+G_DEFINE_TYPE (GtkFrameAccessible, gtk_frame_accessible, GAIL_TYPE_CONTAINER)
+
+static void
+gtk_frame_accessible_initialize (AtkObject *accessible,
+                                 gpointer   data)
+{
+  ATK_OBJECT_CLASS (gtk_frame_accessible_parent_class)->initialize (accessible, data);
+
+  accessible->role = ATK_ROLE_PANEL;
+}
+
+static const gchar *
+gtk_frame_accessible_get_name (AtkObject *obj)
+{
+  const gchar *name;
+  GtkWidget *widget;
+
+  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
+  if (widget == NULL)
+      return NULL;
+
+  name = ATK_OBJECT_CLASS (gtk_frame_accessible_parent_class)->get_name (obj);
+  if (name != NULL)
+    return name;
+
+  return gtk_frame_get_label (GTK_FRAME (widget));
+}
+
+static void
+gtk_frame_accessible_class_init (GtkFrameAccessibleClass *klass)
+{
+  AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+  class->initialize = gtk_frame_accessible_initialize;
+  class->get_name = gtk_frame_accessible_get_name;
+}
+
+static void
+gtk_frame_accessible_init (GtkFrameAccessible *frame)
+{
+}
diff --git a/gtk/a11y/gtkframeaccessible.h b/gtk/a11y/gtkframeaccessible.h
new file mode 100644 (file)
index 0000000..02e638e
--- /dev/null
@@ -0,0 +1,51 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_FRAME_ACCESSIBLE_H__
+#define __GTK_FRAME_ACCESSIBLE_H__
+
+#include "gailcontainer.h"
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_FRAME_ACCESSIBLE                      (gtk_frame_accessible_get_type ())
+#define GTK_FRAME_ACCESSIBLE(obj)                      (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessible))
+#define GTK_FRAME_ACCESSIBLE_CLASS(klass)              (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessibleClass))
+#define GTK_IS_FRAME_ACCESSIBLE(obj)                   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FRAME_ACCESSIBLE))
+#define GTK_IS_FRAME_ACCESSIBLE_CLASS(klass)           (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FRAME_ACCESSIBLE))
+#define GTK_FRAME_ACCESSIBLE_GET_CLASS(obj)            (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessibleClass))
+
+typedef struct _GtkFrameAccessible      GtkFrameAccessible;
+typedef struct _GtkFrameAccessibleClass GtkFrameAccessibleClass;
+
+struct _GtkFrameAccessible
+{
+  GailContainer parent;
+};
+
+struct _GtkFrameAccessibleClass
+{
+  GailContainerClass parent_class;
+};
+
+GType gtk_frame_accessible_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GTK_FRAME_ACCESSIBLE_H__ */
index f63de8091e4dcefc2bb9ad8b495106f7c59e3dd7..07393dea2d878a2147f236be539743c6ebddce4d 100644 (file)
@@ -33,6 +33,7 @@
 #include "gtkintl.h"
 #include "gtkbuildable.h"
 
+#include "a11y/gtkframeaccessible.h"
 
 /**
  * SECTION:gtkframe
@@ -221,6 +222,8 @@ gtk_frame_class_init (GtkFrameClass *class)
   class->compute_child_allocation = gtk_frame_real_compute_child_allocation;
 
   g_type_class_add_private (class, sizeof (GtkFramePrivate));
+
+  gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_FRAME_ACCESSIBLE);
 }
 
 static void